<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/materialdesignicons.min.css" rel="stylesheet">
<link href="css/style.min.css" rel="stylesheet">
<link href="icon/iconfont.css" rel="stylesheet">
<script src="https://cdn.bootcss.com/vue/2.6.9/vue.min.js"></script>
<script src="https://cdn.bootcss.com/axios/0.19.0/axios.min.js"></script>
</head>
  <style>
    .col-lg-12{
      margin: auto;
    top: 17px;
    left: 0;
    bottom: 0;
    right: 0;
    position: absolute;
    }
  </style>
<div class="lyear-layout-web" id="app">
    <div class="lyear-layout-container">
      <!--左侧导航-->
  
      <!--End 左侧导航-->
      
      <!--头部信息-->
   
      <!--End 头部信息-->
      
      <!--页面主要内容-->
  
      <main class="lyear-layout-content" >
        <div class="container-fluid">
          <div class="row">
            <div class="col-lg-12">
              <div class="card">
                <div class="card-toolbar clearfix">
                  <h1>{{tt}}</h1>
                  <form class="pull-right search-bar" method="get" action="#!" role="form">
                    <div class="input-group">
                      <div class="input-group-btn">
                        <input type="hidden" name="search_field" id="search-field" value="title">
                        <button class="btn btn-default dropdown-toggle" id="search-btn" data-toggle="dropdown" type="button" aria-haspopup="true" aria-expanded="false">
                        标题 <span class="caret"></span>
                        </button>
                      </div>
                      <input type="text" class="form-control" v-model="purchase.title" name="keyword" placeholder="请输入标题">
                    </div>
                  </form>
                </div>
                <div class="card-body">
                  <div class="table-responsive">
                    <table class="table table-bordered">
                      <thead>
                        <tr>
                          <th>
                            <label class="lyear-checkbox checkbox-primary">
                              <input type="checkbox" id="check-all"><span></span>
                            </label>
                          </th>
                          <th>序号</th>
                          <th>题名</th>
                          <th>唯一订单号</th>
                          <th>印本ISSN</th>
                          <th>电子版ISSN</th>
                          <th>操作</th>
                        </tr>
                      </thead>
                      <tbody>
                        <tr v-for="(it,index) in list">
                          <td>
                            <label class="lyear-checkbox checkbox-primary">
                              <input type="checkbox" name="ids[]" value=""><span></span>
                            </label>
                          </td>
                          <td>{{it.id}}</td>
                          <td>{{it.title}}</td>
                          <td>{{it.orderNumber}}</td>
                          <td>{{it.pissn}}</td>
                          <td>{{it.eissn}}</td> 
                          <td>
                            <div class="toolbar-btn-action">
                              <a class="btn btn-primary m-r-5" type="warning" @click="agree(it.id)"><i class="mdi mdi-check"></i>通过</a>
                              <a class="btn btn-danger" @click="reject(it.id)"><i class="mdi mdi-window-close"></i> 驳回</a>
                            </div>
                          </td>
                        </tr>
                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </main>
      <!--End 页面主要内容-->
    </div>
  </div>
  <script>
    new Vue({
        el:"#app",
        data:{
            tt:"审核确认页面",
            list:[],
            purchase:{
              title:""
            }
        },
        created () {
              this.getData();
        },
        methods: {
          getData(){
                axios.get(`http://29n01o8660.oicp.vip/purchase/queryConfirmPurchase`).then(res=>{
                     console.log(res);
                     this.list=res.data.data;
                })
          },
          ba(){
             location="purchaseAll.html";
          },
          agree(rid){//修改这条数据的审核状态   荐购完成了
             axios.get("http://29n01o8660.oicp.vip/purchase/purchaseComplete?id="+rid).then(res=>{

                   alert("荐购完成！"); 
                   location.reload();
             })
          },
          reject(rid){//驳回  跳转到我的荐购列表
            axios.get("http://29n01o8660.oicp.vip/purchase/purchaseReject?id="+rid).then(res=>{

                 location="myPurchastList.html";
            })
          }
        }
    })
</script>
</html>